﻿using System;
using System.Runtime.Serialization;

namespace NCMIS.ObjectModel.MetaData
{
    /// <summary>
    /// Represents a property's allowed updatability, i.e. indicates under what circumstances the value of a property may be updated.
    /// </summary>
    [DataContract(Namespace = CmisNs.Cmis)]
    public enum Updatability
    {
        /// <summary>
        /// The value of this property must not ever be set directly by an application. It is a system property
        /// that is either maintained or computed by the repository.
        /// </summary>
        [EnumMember(Value = "readonly")]
        @Readonly,

        /// <summary>
        /// The property value can be modified using the updateProperties service.
        /// </summary>
        [EnumMember(Value = "readwrite")]
        ReadWrite,

        /// <summary>
        /// The property value must only be update-able using a “private working copy” Document, i.e. the
        /// update is either made on a “private working copy” object or made using a “check in” service.
        /// </summary>
        [EnumMember(Value = "whencheckedout")]
        WhenCheckedout,

        /// <summary>
        /// The property value must only be update-able during the Create operation on that Object.
        /// </summary>
        [EnumMember(Value = "oncreate")]
        OnCreate,
    }
}
